using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICDisPlyEntryMap : EntityTypeConfiguration<ICDisPlyEntry>
    {
        public ICDisPlyEntryMap()
        {
            // Primary Key
            this.HasKey(t => t.FEntryID);

            // Properties
            this.Property(t => t.FModel)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FNote)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FXSTMP)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.FFlagSave)
                .IsRequired()
                .HasMaxLength(80);

            // Table & Column Mappings
            this.ToTable("ICDisPlyEntry");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FRelatedID).HasColumnName("FRelatedID");
            this.Property(t => t.FModel).HasColumnName("FModel");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FBegQty).HasColumnName("FBegQty");
            this.Property(t => t.FEndQty).HasColumnName("FEndQty");
            this.Property(t => t.FBegAmt).HasColumnName("FBegAmt");
            this.Property(t => t.FEndAmt).HasColumnName("FEndAmt");
            this.Property(t => t.FCuryID).HasColumnName("FCuryID");
            this.Property(t => t.FDisType).HasColumnName("FDisType");
            this.Property(t => t.FAppScale).HasColumnName("FAppScale");
            this.Property(t => t.FValue).HasColumnName("FValue");
            this.Property(t => t.FBegDate).HasColumnName("FBegDate");
            this.Property(t => t.FEndDate).HasColumnName("FEndDate");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FChecked).HasColumnName("FChecked");
            this.Property(t => t.FXSTMP).HasColumnName("FXSTMP");
            this.Property(t => t.FIndex).HasColumnName("FIndex");
            this.Property(t => t.FB2Emp).HasColumnName("FB2Emp");
            this.Property(t => t.FB2EmpCls).HasColumnName("FB2EmpCls");
            this.Property(t => t.FB2CustCls).HasColumnName("FB2CustCls");
            this.Property(t => t.FB2VipGrp).HasColumnName("FB2VipGrp");
            this.Property(t => t.FFlagSave).HasColumnName("FFlagSave");
            this.Property(t => t.FItemID2).HasColumnName("FItemID2");
        }
    }
}
